import request from '@/utils/request'

// 查询项目列表
export function listItem(query) {
  return request({
    url: '/oa/itemImplementation/list',
    method: 'get',
    params: query
  })
}

// 加载对应部门人员树形结构
export function userDeptTree(id) {
  return request({
    url: '/oa/out/userDeptTree',
    method: 'get'
  })
}

// 获取项目详细信息
export function getItemDetail(id) {
  return request({
    url: '/oa/itemImplementation/' + id,
    method: 'get'
  })
}

// 新增项目
export function addItem(data) {
  return request({
    url: '/oa/itemImplementation',
    method: 'post',
    data: data
  })
}

// 修改项目
export function updateItem(data) {
  return request({
    url: '/oa/itemImplementation',
    method: 'put',
    data: data
  })
}

// 删除项目
export function deleteItem(ids) {
  return request({
    url: '/oa/itemImplementation/' + ids,
    method: 'delete'
  })
}

// 修改项目状态
export function editProjectState(data) {
  return request({
    url: '/oa/itemImpleState',
    method: 'post',
    data: data
  })
}

// 查询项目状态列表
export function projectStateList(query) {
  return request({
    url: '/oa/itemImpleState/list',
    method: 'get',
    params: query
  })
}
